import request from '@/utils/request'

// 添加新的条例规则
export function addNewRuleByData(data) {
  return request({
    url: '/community/service/rules/add',
    method: 'post',
    data: data
  })
}

// 查询所有条例信息
export function getRulesList() {
  return request({
    url: '/community/service/rules/',
    method: 'get'
  })
}

// 修改条例信息
export function updateRule(data) {
  return request({
    url: '/community/service/rules/',
    method: 'put',
    data: data
  })
}

// 删除条例
export function deleteRuleById(ruleId) {
  return request({
    url: '/community/service/rules/' + ruleId,
    method: 'delete'
  })
}

// 删除图片
export function deleteRuleCoverByName(fileName) {
  return request({
    url: '/community/service/rules/deleteImg' ,
    method: 'delete',
    params: {
      fileName: fileName
    }
  })
}
